package com.jackrain.nea.fc.ps.mapper;


import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.HashMap;
import java.util.List;

/**
 * 商品档案查询
 * Mapper
 *
 * @author xuxinshuai
 * @create 2018/05/05
 */
@Mapper
public interface WmsProMapper {

    @Select("select e.ECODE as brand_ecode,\n" +
            "       a.ECODE as pro_ecode,\n" +
            "       a.ENAME AS pro_ename,\n" +
            "       a1.ENAME AS pro_properties,\n" +
            "       a.FACTORYCODE as factory_code,\n" +
            "       a.PRICELIST as price_list,\n" +
            "       c.ENAME as pro_clr,\n" +
            "       d.ENAME as pro_size,\n" +
            "       b.ECODE as sku,\n" +
            "       a.GBCODE as gb_code,\n" +
            "       a.FABDESC as fab_desc,\n" +
            "       a.TXTDIM2 as pro_desc,\n" +
            "       a.TXTDIM3 as pro_property,\n" +
            "       a.REMARK as remark,\n" +
            "       a.ISACTIVE as isactive,\n" +
            "       a2.ENAME as pro_year,\n" +
            "       a3.ENAME as pro_type_depart,\n" +
            "       a4.ENAME as pro_class_type,\n" +
            "       a5.ENAME AS pro_large_class,\n" +
            "       a6.ENAME AS pro_sex,\n" +
            "       a7.ENAME as pro_season,\n" +
            "       80 AS recive_status,\n" +
            "       a.MODIFIEDDATE as write_time,\n" +
            "       null as recive_time,\n" +
            "       null as recive_err_msg,\n" +
            "       a.OWNERENAME as owner_ename,\n" +
            "       a.OWNERNAME as owner_name,\n" +
            "       a.MODIFIERENAME as modifier_ename,\n" +
            "       a.MODIFIERNAME as modifier_name,\n" +
            "       a.MODIFIEDDATE as modified_date\n" +
            "from ps_c_pro a\n" +
            "  join ps_c_sku b on b.PS_C_PRO_ID = a.ID\n" +
            "  join PS_C_SPECOBJ c on b.PS_C_SPEC1OBJ_ID = c.ID\n" +
            "  join PS_C_SPECOBJ d on b.PS_C_SPEC2OBJ_ID = d.ID\n" +
            "  join PS_C_BRAND e on a.PS_C_BRAND_ID = e.ID\n" +
            "  left join PS_C_PRODIM_ITEM a1 on a.PRONATURE = a1.ID\n" +
            "  left join ps_c_prodim_item a2 on a.PROYEAR = a2.ID\n" +
            "  left join ps_c_prodim_item a3 on a.NUMDIM26 = a3.ID\n" +
            "  left join ps_c_prodim_item a4 on a.NUMDIM6 = a4.ID\n" +
            "  left join ps_c_prodim_item a5 on a.LARGECLASS = a5.ID\n" +
            "  left join ps_c_prodim_item a6 on a.SEX = a6.ID\n" +
            "  left join ps_c_prodim_item a7 on a.PROSEA = a7.ID\n" +
            "where a.CP_C_DISTRIB_ID = 0 AND a.ID IN ( #{ids} )")
    List<HashMap> selectwmsprosql(String ids);


}
